logo

Section 1: Introduction

1.1 What is ‘AirPassengers’

AirPassengers
##      Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
## 1949 112 118 132 129 121 135 148 148 136 119 104 118
## 1950 115 126 141 135 125 149 170 170 158 133 114 140
## 1951 145 150 178 163 172 178 199 199 184 162 146 166
## 1952 171 180 193 181 183 218 230 242 209 191 172 194
## 1953 196 196 236 235 229 243 264 272 237 211 180 201
## 1954 204 188 235 227 234 264 302 293 259 229 203 229
## 1955 242 233 267 269 270 315 364 347 312 274 237 278
## 1956 284 277 317 313 318 374 413 405 355 306 271 306
## 1957 315 301 356 348 355 422 465 467 404 347 305 336
## 1958 340 318 362 348 363 435 491 505 404 359 310 337
## 1959 360 342 406 396 420 472 548 559 463 407 362 405
## 1960 417 391 419 461 472 535 622 606 508 461 390 432

As shown above ‘AirPassengers’ is a time series data set showing the amount of airline passengers a month from 1949 to 1960.

1.2 The purpose of this project

This project will look into Meta Prophet predictions using the ‘AirPassengers’ time series dataset and seeing how true they are, and if they are not giving reasons as to why it isn’t.

1.3 Data preparation steps

#install.packages("prophet")

Installs the prophet package from CRAN.

library(prophet)
## Loading required package: Rcpp
## Loading required package: rlang

Loads the prophet package into the r session.

#install.packages("remotes")

Installs the remotes package, which is used to load other packages not in the CRAN.

remotes::install_github('facebook/prophet@*release', subdir='R')
## Skipping install of 'prophet' from a github remote, the SHA1 (2a57e9d3) has not changed since last install.
##   Use `force = TRUE` to force installation

Installs the latest release of prophet from GitHub.

data("AirPassengers")

Loads the AirPassengers data explained in section 1.1.

start_date <- as.Date("1949-01-01")

Representing the start date of the time series.

dates <- seq(start_date, by = "month", length.out = length(AirPassengers))

Generates a sequence of dates, atattching each data in the AirPassengers data set to a month starting from 01/01/1949

air.df <- data.frame(
    ds = dates,
    y = as.numeric(AirPassengers)
)

Makes a dataframe that will work with prophet, where ‘ds’ is the data sequence and ‘y’ is the number of passengers.

m <- prophet(air.df)
## Disabling weekly seasonality. Run prophet with weekly.seasonality=TRUE to override this.
## Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.

Fits the prophet model to air.df.

future <- make_future_dataframe(m, periods = 100, freq = "month")

Creates a future dataframe for making predictions.

forecast <- predict(m, future)

Uses the fitted model m to make predictions for the future.

plot(m, forecast)

Plots the forecast.

1.4 Findings

As shown in the image above, in 1950 the monthly number of aier passengers was at roughly 1.25 million, an annual number of 15 million . This rose to roughly 5 million a month in 1960, an annual number of 60 million.

The future is then forcasted, with an annual number of 100 million air passengers by 1970. This however can be shown to be false.

As shown in the image above the actual number of global airline passengers in 1970 was 382.95 million. This can be explained however. The meta prophet forecast was based on the historical data, which did not account for massive increases in airline technology and globalisation advancements.

Some of these advancements include:

The Boeing 747 was a huge leap in commercial air travel, it was a much larger aircraft whilst also being more cost effective. This allowed people to travel at a cheaper and more attractive price point.

The Concorde was also a another giant leap. it allowed travel to be much quicker in turn making air travel even more attractive through how efficient it was.

Deregulation also played a key role into the increase in air travel in the 1970s. The Airline Deregulation Act allowed airlines to set their own prices and routes, which caused increased competition and lower prices.

Lastly there was also a big cultural shift when it came to air travel. More people became excited by the idea of experiencing different cultures and meeting different people.